package Offer_58;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/3/30 11:21
 */
public class Solution {
    public static void main(String[] args) {
        String s =  "abcdefdsadassadsadsadsag";
        int n =2;
        reverseLeftWords(s,n);
    }
    public static String reverseLeftWords(String s, int n) {
        StringBuilder sb = new StringBuilder(s);
        for (int i = 0; i < n; i++) {
            sb.append(s.charAt(i));
        }
        return sb.delete(0,n).toString();
    }

    public static String reverseLeftWords1(String s, int n) {
        String s1 =  s.substring(0,n);
        String s2 =  s.substring(n,s.length());
        return s2+s1;
    }
}
